Skip to content

Conversation

staabm
Copy link
Owner

@staabm staabm commented Feb 4, 2022

to ease debugging of errors like #225 (comment)

@@ -119,6 +119,10 @@ public function getResultType(string $queryString, int $fetchType): ?Type
{
$result = $this->simulateQuery($queryString);
if (!\is_array($result)) {
if (QueryReflection::getRuntimeConfiguration()->isDebugEnabled() && $result instanceof mysqli_sql_exception) {
throw new UnresolvableQueryException(sprintf("Cannot simulate query\n %s \nbecause of a sql error: %s", $queryString, $result->getMessage()));
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: separate exception type

@staabm staabm changed the title debug-mode: throw exception when query is not simulatable debug-mode: report error when query is not simulatable Feb 6, 2022
@staabm
Copy link
Owner Author

staabm commented Feb 6, 2022

Todo: make this report a phpstan error instead of a uncaught exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants